From: vhanquez@kneesa.uk.xensource.com Date: Mon, 9 Jan 2006 13:11:55 +0000 (+0000) Subject: free trans if allocated, if dev_request_and_reply fail. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16551^2~2^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=9652e9b451e7055fb8a11f74a39f719d150cc653;p=xen.git free trans if allocated, if dev_request_and_reply fail. Signed-off-by: Vincent Hanquez --- diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c index e175b4e9ea..b7a7d892f5 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c @@ -109,7 +109,7 @@ static ssize_t xenbus_dev_write(struct file *filp, size_t len, loff_t *ppos) { struct xenbus_dev_data *u = filp->private_data; - struct xenbus_dev_transaction *trans; + struct xenbus_dev_transaction *trans = NULL; void *reply; if ((len + u->len) > sizeof(u->u.buffer)) @@ -141,8 +141,10 @@ static ssize_t xenbus_dev_write(struct file *filp, } reply = xenbus_dev_request_and_reply(&u->u.msg); - if (IS_ERR(reply)) + if (IS_ERR(reply)) { + kfree(trans); return PTR_ERR(reply); + } if (u->u.msg.type == XS_TRANSACTION_START) { trans->handle = (struct xenbus_transaction *)